home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Frameworks / Extension Shell 1.3 / Sample Extensions / Generic ES Handler ƒ / Generic ES Handler ReadMe < prev   
Encoding:
Text File  |  1994-04-05  |  3.1 KB  |  58 lines  |  [TEXT/R*ch]

  1. Generic ES Handler
  2. ------------------
  3.  
  4. The Generic ES Handler is a generic Handler resource for use with Extension Shell. As it stands it won't
  5. actually do anything, but you can use it as a starting point for writing your own handlers. You may find
  6. it more usefull to clone one of the sample Extensions, depending on what you're writing.
  7.  
  8.  
  9. When cloning the generic handler, you will have to change the following #defines:
  10.  
  11.  
  12.     • The #defines in "ES Handler.h". In particular, the details that are relevent to
  13.       error strings, disabled icons, and enabled icons may need to be changed for your
  14.       particular Extension.
  15.   
  16.     • The #defines in "CodeConstants.h". For each item you want to install with Extension
  17.       Shell, you should #define its name to a valid index value for the code details array.
  18.       This #define is used both by the handler (for setting up the code resource's details in
  19.       the code details array, and for interpreting the errorIndex field of the ESParamBlock)
  20.       and by your actual code resources themselves. They can use this constant to find out
  21.       which slot in the address table contains their information. If you use an address table,
  22.       this is a good place to define the selector associated with your Extension's table. You
  23.       should also supply defines for the resource type, and ID, of your installed code.
  24.  
  25.  
  26.  
  27. And the actual routines:
  28.   
  29.     • The InitialiseParamBlock() function in "ES Handler.c". The code that deals with icons,
  30.       and bombing out if System 7 isn't present is generic, and won't need to be changed.
  31.       However, the actual installation details will need to be changed for your particular
  32.       Extension - basically by putting the relevent #defines into the supplied templates.
  33.     
  34.       NB - The logic flow for Extensions and Control Panels is different for when it comes
  35.       to handling disabling-due-to-mouse-down-at-startup situations. See
  36.       ‘Extension Shell (Source) ReadMe’ for the reason.
  37.     
  38.     • The InitialiseAddrsTable() function in "ES Handler.c". You may or may not need to
  39.       initialise the address table. The idea of this message was to make Extension Shell
  40.       more suitable for writing Control Panels. In a Control Panel, the address table code
  41.       will probably have been replaced by some custom code that embeds an address table
  42.       at the start of a larger structure. The other fields in this structure will be some sort
  43.       of preferences resource that installed code (trap patches, etc) can read to find out
  44.       what to do. InitialiseAddrsTable() should read a preferences resource in and store the
  45.       relevent values away for the later code to find. It will be called after the address table
  46.       has been installed, but before any other code has been installed.
  47.     
  48.     • The HandleTheError() function in "ES Handler.c". You may or may not want to beep, post
  49.       error messages, and uninstall any already installed code. This is basically a matter of
  50.       setting fields to true or false, but you may need to flesh out the details of the switch
  51.       statement if you're planning to do any error handling. Again, the icon handling code is
  52.       generic.
  53.  
  54.  
  55.  
  56. Of course, if you also want to use a custom address table, you will need to clone the 'AddrsTable.π'
  57. project.
  58.